package query

type SysDevSchemaQuery struct {
	IdSn         string `form:"idSn"  search:"type:eqOr;column:id,dev_sn;table:sys_dev_schema"`
	Sn           string `form:"sn"  search:"type:exact;column:dev_sn;table:sys_dev_schema"`
	ProductId    string `form:"productId"  search:"type:exact;column:dev_product_id;table:sys_dev_schema"`
	ProductModel string `form:"productModel"  search:"type:exact;column:product_model;table:sys_dev_schema"`
	Path         string `form:"path" search:"-"`

	SnIn        []string `search:"type:in;column:dev_sn;table:sys_dev_schema"`
	ProductIdIn []string `search:"type:in;column:dev_product_id;table:sys_dev_schema"`
}

func (m *SysDevSchemaQuery) GetNeedSearch() interface{} {
	return *m
}

func (m *SysDevSchemaQuery) IsParamValid() bool {
	return len(m.IdSn) > 0 || len(m.Sn) > 0 || len(m.ProductId) > 0 || len(m.SnIn) > 0 || len(m.ProductIdIn) > 0 || len(m.ProductModel) > 0
}

type SysDevProfileQuery struct {
	IdSn      string `form:"idSn"  search:"-"`
	Path      string `form:"path" search:"-"`
	ProductId string `form:"productId"  search:"-"`
}
